package com.shanzmoo.db.sys.entity.dto;

import com.alibaba.fastjson.JSON;
import com.shanzmoo.db.sys.entity.MenuEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;

/**
 * 菜单更新对象
 * @author: Gzhao 2020/11/10
 */
@Data
@ApiModel("菜单更新对象")
public class MenuUpdateDto extends MenuSaveDto{

    @NotNull(message = "菜单Id不允许为空")
    @ApiModelProperty("菜单Id" )
    private Integer menuId;

    public static MenuEntity converted(MenuUpdateDto saveDto) {
        return JSON.parseObject(JSON.toJSONString(saveDto), MenuEntity.class);
    }
}
